import { useEditor, EditorContent } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'
import './style.scss' // 引入样式文件

const TiptapEditorWithDecorator = () => {
  const editor = useEditor({
    extensions: [StarterKit],
    content: '<p>这里是编辑器的内容，您可以开始输入...</p>'
  })

  return (
    <div className="editor-wrapper">
      {/* 固定的高亮词 */}
      <div className="ai-highlight-tag">AI编程</div>

      {/* 编辑器 */}
      <div className="editor-container">
        <EditorContent editor={editor} />
      </div>
    </div>
  )
}

export default TiptapEditorWithDecorator
